//
//  DmsWrapper.h
//  DLNADemo
//
//  Created by apple on 14-12-18.
//  Copyright (c) 2014年 skyworth.digital. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>
#import <AssetsLibrary/AssetsLibrary.h>

/**
 *  多媒体文件的类型枚举
 */
typedef NS_ENUM(NSUInteger, MediaType){

    MEDIA_AUDIO,

    MEDIA_PHOTOS,

    MEDIA_VIDEO,

    MEDIA_DIRECTTV,

    MEDIA_PVRREC,

    MEDIA_EPG,
};

@protocol DmsWrapperDelegate <NSObject>
@optional
-(void)DmsDidRestarted;

@end


@protocol DmsWrapperDatasource <NSObject>

-(NSArray*)mediaInfoWithType:(MediaType)type Index:(int)index Count:(int)count;

@optional
-(int)folderChildrenCount:(MediaType)mediaType;

@end

@interface DmsWrapper : NSObject

@property (strong,nonatomic) id<DmsWrapperDelegate> delegate;
@property (strong,nonatomic) id<DmsWrapperDatasource> datasource;

@property (strong,nonatomic) NSArray *photosArray;
@property (strong,nonatomic) NSArray *musicsArray;
@property (strong,nonatomic) NSArray *videosArray;
@property (nonatomic) float translationProgress;


+(DmsWrapper*)sharedDmsWrapper;
+ (ALAssetsLibrary *)defaultAssetsLibrary;

-(void)start;
-(NSString*)getIpAddress;
-(NSString*)getDmsName;
-(void)stop;

-(void)getImage:(NSURL *)videoURL CompleteBlock:(void(^)(UIImage * image))block;

-(NSString*)translatePath:(NSString*)path;
-(NSData*)dataForIconResourceWithRequestPath:(NSString*)path;
-(BOOL)checkFileIsExistWithFileName:(NSString*)fileName itemUrl:(NSString*)url;
-(void)cancelExport;
@end
